function checkboxAll() {
    let localdata = localData("productlist")
    let quan = document.querySelector("input[name='checkall']")
    let danxuan = document.querySelectorAll("input[name='checksingle']")
    let ofa = quan.checked
    if (ofa == true) {
        for (let i = 0; i < danxuan.length; i++) {
            localdata.updata($(danxuan[i]).attr("data-id"),{checked:true})
        }
    } else {
        for (let i = 0; i < danxuan.length; i++) {
            localdata.updata($(danxuan[i]).attr("data-id"),{checked:false})
        }
    }
    checkbox()
    console.log(quan.checked);
    getproduct_list()
}

function checkBoxSingle() {
    let quan = document.querySelector("input[name='checkall']")
    let danxuan = document.querySelectorAll("input[name='checksingle']")
    for (let i = 0; i < danxuan.length; i++) {
        if (danxuan[i].checked == false) {
            checkbox()
            return quan.checked = false
        }
    }
    quan.checked = true
    if(danxuan.length==0){
        quan.checked = false
    }
    checkbox()
}